package resturant;


public class OrderItem implements Comparable<OrderItem>  {
	
	private Integer tableNumber;
	private String ordername ;
	private int quantity ;
	
	public OrderItem(int _tableNumber, String _ordername, int _quantity){
		
		setTableNumber(_tableNumber);
		setOrderName(_ordername);
		setQuantity(_quantity);
	}
	
	public void setTableNumber (int t) {  
    	tableNumber = t;  
     }  

     public int getTableNumber() {  
     return tableNumber;  
     } 
     
     public void setOrderName (String t) {  
    	 ordername = t;  
      }  

     public String getOrderName() {  
      return ordername;  
      } 
      
      public void setQuantity (int t) {  
    	  quantity = t;  
       }  

       public int getQuantity() {  
       return quantity;  
       } 

       public int compareTo(OrderItem other) {
    	   int i = ordername.compareTo(other.ordername);
    	   if (i != 0) return i;
    	   i = tableNumber.toString().compareTo(other.tableNumber.toString());
      		return i;
      	}
      	
}
